package com.xwli.apache.camel;

import freemarker.template.Configuration;
import freemarker.template.Template;
import org.springframework.ui.freemarker.FreeMarkerTemplateUtils;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * @author xwli
 * @date: 2023/6/21 10:59
 * @desc
 * @since JDK 1.8
 */
public class FreeMakerTestUtils {
    public static void main(String[] args) {
        String content = "【编排中心】自动化环节处理失败，请您及时登录系统人工处理!\n" +
                "【${serviceType}业务】:\n" +
                "<#if title??>\n" +
                "  工单主题: ${title}\n" +
                "</#if>\n" +
                "  工单号: ${orderCode}\n" +
                "  当前环节: ${taskName}\n" +
                "<#if limitTime??>\n" +
                "  网络部SLA处理时限: ${limitTime\n" +
                "?string(\"yyyy-MM-dd HH:mm:ss\")\n" +
                "}\n" +
                "</#if>      ";
        Configuration freeMarkerConfiguration = new Configuration(Configuration.VERSION_2_3_22);
        /*Template template = new Template(smsTemplateName, optionalSmsModel.get().getContent(), freeMarkerConfiguration);
        Map<String, Object> model = new HashMap<>();
        model.put("serviceType", "智能组网专线");
        model.put("orderCode", UUID.randomUUID().toString());
        model.put("taskName", "业务受理");
        model.put("title", "测试");
        model.put("limitTime", limitTime);
        String realContent = FreeMarkerTemplateUtils.processTemplateIntoString(template, model);*/
    }
}

